package com.tengju.user.domain.model.archive.sign;

import com.fasterxml.jackson.annotation.JsonValue;
import com.tengju.user.domain.model.login.LoginType;

public enum SelfCertificationStatus {


    UNAPPROVED(0, "待审核"),
    APPROVED(1, "通过"),
    REJECTED(2, "拒绝"),
    TERMINATED(3, "终止"),
    ;

    private int val;
    private String desc;

    SelfCertificationStatus(int val, String desc) {
        this.val = val;
        this.desc = desc;
    }

    @JsonValue
    public int getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    public static SelfCertificationStatus fromVal(Integer val) {
        for (SelfCertificationStatus status : values()) {
            if (status.val == val) {
                return status;
            }
        }
        return null;
    }


    public static SelfCertificationStatus fromName(String name) {
        for (SelfCertificationStatus status : values()) {
            if (status.name().equals(name)) {
                return status;
            }
        }
        return null;
    }
}
